package Thread;

import java.util.concurrent.BlockingDeque;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.LinkedBlockingQueue;

//阻塞队列
public class Demo17 {
    public static void main(String[] args) throws InterruptedException {
        BlockingQueue<String> queue = new LinkedBlockingQueue();
        queue.put("hello");//这个put也能够使用interrupt进行唤醒
        String s = queue.take();
        System.out.println(s);
        String elem = queue.take();
        System.out.println(elem);
    }
}
